// pages/index/charges/charges.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    type: true,
    data: '',
  },
  onLoad:function(){
    this.getzj()
  },
  getzj:function(){
    let that = this;
    let type = that.data.type ? '2' : '1';
    app.post('/shop/getProperty', { type: type }).then(res => {
      that.setData({
        data: res,
      })
    })
  },
  switchType: function (e) {
    console.log(e)
    if (e.currentTarget.dataset.select == 'selected')
      return false;
    let that = this;
    this.setData({
      type: !that.data.type
    })
    this.getzj()
  },
})